from python.util import getCompId

data: str = "广东顺德伯渡服务外包营运管理有限公司\t  南海屈臣氏\t罗杰\t13714652979\n" + "安徽数集通劳务服务有限公司\t浙江品勤-顺德人事项目   \t罗杰\t13714652979"
vals = "('{0}', '{1}', '{2}', '{3}',  now())"


def parseRow():
    sql = ("INSERT INTO reim_project(comp_id, comp_name, project_name,  admin_staff, create_time) VALUES ")
    for datas in data.split("\n"):
        row = datas.split("\t")
        comp = row[0]
        projectName = row[1]
        formatData = vals.format(getCompId(comp), comp, projectName, row[2], row[3])
        sql += formatData + ",\n"
    return sql


sql = parseRow()
print(sql[0:sql.find(',', -3)])
